package org.exhaust.barbecue.action;

import org.exhaust.barbecue.AbstractRequest;
import org.exhaust.barbecue.AbstractResponse;
import org.exhaust.barbecue.Action;
import org.exhaust.barbecue.ActionContext;

public abstract class AbstractServiceAction<M extends AbstractRequest, N extends AbstractResponse> implements Action {
    @Override
    public boolean perform(AbstractRequest request, AbstractResponse response, ActionContext context) {
        return this.service((M) request, (N) response, context);
    }

    protected abstract boolean service(M request, N response, ActionContext context);
}
